package chixing.day18.class2;

public class NumberThread implements Runnable{
    private CharThread charThread;
    public NumberThread(CharThread charThread)
    {
        this.charThread = charThread;
    }
    public NumberThread()
    {
    }
    public void run()
    {
        for (int i = 0; i < 100; i++)
        {
            if (i % 2 == 0)
            {
                System.out.println(i);
            }

        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        if(i==10){
            try {
                charThread.join(400);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }
    }
    }
}
